package com.tensquare.qa.service;

import com.tensquare.qa.dao.ProblemDao;
import com.tensquare.qa.pojo.Problem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by WF on 2020/12/15 15:57
 */
@Service
public class ProblemService {
    @Autowired
    private ProblemDao problemDao;
    //1.查询最新问题列表
    public List<Problem> newlist(Integer labelid, Integer page, Integer size) {
        return problemDao.findnewList(labelid, PageRequest.of(page-1,size));
    }

    //2.查询热门问题列表成功
    public List<Problem> hotlist(Integer labelid, Integer page, Integer size) {
        return problemDao.findhotList(labelid,PageRequest.of(page-1,size));
    }
}
